import { Map } from 'immutable'
import * as actionTypes from './constants'
const defaultState = Map({
  searchSuggest: {},
  searchResult:{}
})

export default function reducer(state = defaultState, action) {
  switch (action.type) {
    case actionTypes.CHANGE_SEARCH_SUGGESTION_RESULT_ACTION:
      return state.set('searchSuggest', action.searchSuggest)
    case actionTypes.CHANGE_SEARCH_RESULT_ACTION:
      return state.set('searchResult',action.searchResult)
    default:
      return state
  }
}